From: Florian Müllner Date: Thu, 7 Mar 2019 19:26:12 +0000 (+0100) Subject: network: Catch errors when reading devices X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~871^2^2~21 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4fa5d701d536370084afa89acf43de79e4f14e25;p=gnome-shell.git network: Catch errors when reading devices NetworkManager added support for a new device - NMDeviceWifiP2P - but did not add the corresponding enum value in NMDeviceType. The return value for nm_device_get_device_type() is therefore "illegal" for the newly added device, and gjs throws an exception. This should ultimately be fixed in libnm, but as errors when adding one device shouldn't interfere with adding any other devices, catching exception is a good idea anyway, so do just that. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1023 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 77a6202b8..e6551f217 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1673,7 +1673,11 @@ var NMApplet = class extends PanelMenu.SystemIndicator { _readDevices() { let devices = this._client.get_devices() || [ ]; for (let i = 0; i < devices.length; ++i) { - this._deviceAdded(this._client, devices[i], true); + try { + this._deviceAdded(this._client, devices[i], true); + } catch (e) { + log(`Failed to add device ${devices[i]}: ${e}`); + } } this._syncDeviceNames(); }